//
//  LGDeviceSendTypeView.m
//  HeartDiseaseManage
//
//  Created by 1234 on 2023/11/9.
//

#import "LGDeviceSendTypeView.h"

@interface LGDeviceSendTypeView()

/**   */
@property (nonatomic , strong)UIView *baseView;

@end

@implementation LGDeviceSendTypeView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self.titleBtn setTitle:@"领用方式" forState:UIControlStateNormal];
        [self.titleBtn setImage:[UIImage imageNamed:@"设备发货-领用方式"] forState:UIControlStateNormal];
        [self addSubview:self.baseView];
        [self.baseView addSubview:self.postBtn];
        [self.baseView addSubview:self.offlineBtn];
        [self.baseView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self).offset(-viewPix(12));
            make.width.equalTo(@(viewPix(160)));
            make.height.equalTo(@(viewPix(32)));
            make.centerY.equalTo(self.titleBtn);
        }];
    }
    return self;
}


-(UIView *)baseView{
    if(!_baseView){
        _baseView = [[UIView alloc] init];
        _baseView.backgroundColor = [UIColor colorWithString:@""];
        _baseView.cornerRidus = 5;
    }
    return _baseView;
}

-(UIButton *)postBtn{
    if(!_postBtn){
        _postBtn = [UIButton buttonWithTitle:@"邮寄" titleFont:LGFont(15) normalColor:@"#000000" selectColor:@"#FFFFFF"];
        _postBtn.frame = CGRectMake(0, 0, viewPix(80), viewPix(32));
        [_postBtn setBackgroundColor:[UIColor colorWithString:@"#F2F4F5"] forState:UIControlStateNormal];
        [_postBtn setBackgroundColor:[UIColor colorWithString:@"#3291FF"] forState:UIControlStateSelected];
    }
    return _postBtn;
}

-(UIButton *)offlineBtn{
    if(!_offlineBtn){
        _offlineBtn = [UIButton buttonWithTitle:@"线下领取" titleFont:LGFont(15) normalColor:@"#000000" selectColor:@"#FFFFFF"];
        _offlineBtn.frame = CGRectMake(viewPix(80), 0, viewPix(80), viewPix(32));
        [_offlineBtn setBackgroundColor:[UIColor colorWithString:@"#F2F4F5"] forState:UIControlStateNormal];
        [_offlineBtn setBackgroundColor:[UIColor colorWithString:@"#3291FF"] forState:UIControlStateSelected];
    }
    return _offlineBtn;
}


@end
